package com.lovo.cloud.controller;

import com.lovo.util.dto.MovieDTO;
import com.lovo.util.dto.MovieNumDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

/**
 * @author cwl
 * @date 2020/11/30 16:52
 * @description 购票
 */
@RestController
@RequestMapping("/movie")
public class BuyTicketController {
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/buy")
    public String buy( String name,
                     Integer num) {
        System.out.println("1111");
        String result =
                restTemplate.getForEntity("http://localhost:8088/buy/"
                        + name + "/" + num, String.class).getBody();
        return "成功";

    }
}
